﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="Index" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/indexstyle.css" rel="stylesheet" />
    <script type="text/javascript" src="JavaScript/Common.js"></script>
    <title></title>
    <script type="text/javascript" >
        function nodeLoad(node) {
            //Ext.net.DirectMethods.NodeLoad(node.id, {
            //    success: function (result) {
            //        var data = eval("(" + result + ")");
            //        node.loadNodes(data);
            //    },

            //    failure: function (errorMsg) {
            //        Ext.Msg.alert('Failure', errorMsg);
            //    }
            //});
        }


        function loadExample(href, id, oviewName) {
            var tab = ExampleTabs.getComponent(id);
            if (tab) { ExampleTabs.setActiveTab(tab); }
            else {
                createExampleTab(id, href, oviewName);
            }
        }

        function createExampleTab(id, url, oviewName) {
            var tab, hostName, node;
            hostName = window.location.protocol + "//" + window.location.host;
            tab = ExampleTabs.add(new Ext.Panel({
                id: id,
                title: oviewName,
                autoLoad: {
                    showMask: true,
                    scripts: true,
                    mode: "iframe",
                    url: hostName + url
                },
                listeners: {
                    deactivate: {
                        fn: function (el) {
                            if (this.sWin && this.sWin.isVisible()) {
                                this.sWin.hide();
                            }
                        }
                    }
                },
                closable: true
            }));
            ExampleTabs.setActiveTab(tab);
            node = tabTree.getNodeById(id);
            if (node) {
                node.ensureVisible();
            }
        }

        function TreeClickHandler(node,e) {
            if (node.isLeaf()) {
                e.stopEvent();
                loadExample(node.attributes.href, node.id, node.text);
            }
        }
        var passEditWin;
        function OpenEditPassWord()
        {
            passEditWin = E = new Ext.Window({
                id: "myWin",
                title: "修改密码",
                width: 300,
                height: 200,
                layout: "fit",
                autoShow: true,
                closeAction: 'close',
                html: '<iframe style="overflow:auto;width:100%; height:100%;" src="SYS_POPEDOM/SYS_PWD_EDIT.aspx" frameborder="0"></iframe>',
            });
            passEditWin.show();
        }

    </script>
</head>
<body>
    <ext:ResourceManager runat="server" />
    <ext:Viewport runat="server">
        <Content>
            <ext:BorderLayout ID="BorderLayout1" runat="server">
                <North Split="false">
                    <ext:Panel ID="pnlNorth" runat="server" Border="false" Header="false" Height="50" >
                        <Content>
                            <div class="top" style="background-color:#0f5499;" >
                                <div class="logo fl" style="line-height: 50px;padding-left:12px;color:#ffffff;font-size: 30px;" ><%--<img src="images/logo.png" alt=""/>--%>经销商物品管理系统</div>
                                <span class="fr">
                                    <ul>
                                        <li >您好！欢迎使用！</li>
                                        <li> <a href="#" class="login"><%=BS_LoginUserName %></a></li>
                                        <li> <a href="#" class="login" onclick="OpenEditPassWord();" >修改密码</a></li>
                                        <li> <a href="Login.aspx?loginoff=loginoff" class="login">退出登录</a></li>
                                    </ul>
                                </span>
                                <div class="clear"></div>
                            </div>
                        </Content>
                    </ext:Panel>
                </North>
                <West Collapsible="true" Split="true" MinWidth="214">
                    <ext:Panel runat="server" Title="功能导航" ID="Panel1" Width="210" TitleCollapse="true"
                        Border="false" Layout="FitLayout">
                        <Content>
                            <ext:TreePanel ID="tabTree" runat="server" Border="false" Cls="treePnl" Lines="true"
                                CollapseFirst="false" AutoScroll="true" ContainerScroll="true" RootVisible="false">
                                <Root>
                                </Root>
                                <Listeners>
                                    <BeforeLoad Fn="nodeLoad" />
                                    <Click Fn="TreeClickHandler" />
                                </Listeners>
                            </ext:TreePanel>
                        </Content>
                    </ext:Panel>
                </West>
                <Center>
                    <ext:Panel runat="server" Layout="FitLayout">
                        <Content>fddsfsdfds
                            <ext:TabPanel ID="ExampleTabs" runat="server" ActiveTabIndex="0" EnableTabScroll="true"
                                Border="false" Title="Center" Padding="0">
                                <Items>
                                    <ext:Panel runat="server" Title="系统首页" Layout="FitLayout"  >
                                        <AutoLoad Url="HomePage.aspx" Mode="IFrame" ShowMask="false" /> 
                                    </ext:Panel>
                                </Items>
                                <Plugins>
                                    <ext:TabCloseMenu CloseTabText="关闭" CloseOtherTabsText="除此之外全部关闭" runat="server" />
                                </Plugins>
                            </ext:TabPanel>
                        </Content>
                    </ext:Panel>
                </Center>
            </ext:BorderLayout>
        </Content>
    </ext:Viewport>
</body>
</html>
